package com.zzyl.mapper;

import com.zzyl.entity.NursingProjectPlan;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface NursingProjectPlanMapper {

    // 插入护理项目计划
    int insertNPP(NursingProjectPlan nursingProjectPlan);

    // 更新护理项目计划
    int updateNPP(NursingProjectPlan nursingProjectPlan);

    // 根据id删除护理项目计划
    int deleteByIds(List<Long> ids);

    // 根据id查询护理项目计划
    NursingProjectPlan getById(Long id);


    // 批量插入护理项目计划
    int insertNppList(@Param("list") List<NursingProjectPlan> projectPlans);

    // 根据项目IDs批量查询护理项目计划记录
    List<NursingProjectPlan> listAllByProjectIds(List<Long> ids);

    // 根据护理计划ID查询护理项目计划
    List<NursingProjectPlan> listAllByPlanId(Long nursingPlanId);


   // 根据护理计划删除关联关系
    @Delete("delete from nursing_project_plan where plan_id = #{nursingPlanId}")
    void deleteByNursingPlanId(@Param("nursingPlanId") Long nursingPlanId);

}
